package cn.baiweigang.uu.constants;

import cn.baiweigang.uu.model.ApiKeyInfo;
import cn.baiweigang.uu.utils.PropertiesUtil;

import java.util.HashMap;
import java.util.Map;

public class BtcConfig {
    //缓存账号key信息
    private static Map<String, ApiKeyInfo> apiCache;
    public static String HB_HOST = PropertiesUtil.getProperty("HB_HOST");
    public static String ACCOUNT_NAME = PropertiesUtil.getProperty("ACCOUNT_NAME");

    public static ApiKeyInfo getApiKey(String accountName) {
        return apiCache.get(accountName);
    }

    public static void setApiKey(String accountName, String apiKey, String secretKey) {
        if (apiCache == null) apiCache = new HashMap<>();
        ApiKeyInfo apiKeyInfo = new ApiKeyInfo();
        apiKeyInfo.setApiKey(apiKey);
        apiKeyInfo.setSecretKey(secretKey);
        apiCache.put(accountName, apiKeyInfo);
    }

}
